import { createApp } from "vue";
import "./style.less";
import "./assets/font/font.css";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import router from "./router/index";
import App from "./App.vue";
import "virtual:windi.css";
import Vue3SeamlessScroll from "vue3-seamless-scroll";
import { createPinia } from "pinia";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

// 将 router 挂载到全局对象
window.globalRouter = router;
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app
  .use(ElementPlus)
  .use(router)
  .use(pinia)
  .use(Vue3SeamlessScroll)
  .mount("#app");
